**************************************************************************************************
*** This do file creates the replication results for 
*** The Pandemic Predominantly Hits Poor Neighbourhoods, or does it? SARS-CoV-2 Infections and Covid-19 Fatalities in German Local Districts (with Thomas Plümper)
*** European Journal of Public Health (forthcoming). https://doi.org/10.1093/eurpub/ckaa168
							
**************************************************************************************************
**************************************************************************************************
/* Note: You have to change "local DIR" to the directory you copy the original stata files contained 	*/
/* in the zip file and then run the do file. 
/* You must have Stata version 13 or higher installed													*/
**************************************************************************************************
*/

drop _all
clear matrix
clear mata


capture net install outreg2, from(http://fmwww.bc.edu/RePEc/bocode/o)			/* checks whether outreg2 is installed 		*/


***********************************************************************************
local DIR = "D:\Research\Health for all database\Germany\"  /*change relative path to the directory where the files are located */
cd "`DIR'"
***********************************************************************************


use "Article for European Journal of Public Health (C19).dta", replace


*** Table 1

* Model 1
reg  cases_0413_rki_pc  taxable_income_pc     anteil_beschaftigte_mit_akademis     stadtraum_dummy extreme_periphery_dummy latitude share_catholic  , vce(robust)
outreg2 using table1.xls, excel replace  ci 2aster

* Model 2
reg cases_new_0519_0413_pc cases_0413_rki_pc  taxable_income_pc     anteil_beschaftigte_mit_akademis     stadtraum_dummy extreme_periphery_dummy latitude share_catholic  , vce(robust)
outreg2 using table1.xls, excel append   ci 2aster


* Model 3
reg  deaths_0413_rki_pc  taxable_income_pc     anteil_beschaftigte_mit_akademis     stadtraum_dummy extreme_periphery_dummy latitude share_catholic  , vce(robust)
outreg2 using table1.xls, excel append   ci 2aster

* Model 4
reg deaths_new_0519_0413_pc cases_0413_rki_pc  taxable_income_pc     anteil_beschaftigte_mit_akademis     stadtraum_dummy extreme_periphery_dummy latitude share_catholic  , vce(robust)
outreg2 using table1.xls, excel append   ci 2aster



*** Table 2

* Model 5
reg  cases_0413_rki_pc  unemployment_rate     anteil_beschaftigte_mit_akademis      stadtraum_dummy extreme_periphery_dummy latitude share_catholic  , vce(robust)
outreg2 using table2.xls, excel replace   ci 2aster

* Model 6
reg cases_new_0519_0413_pc cases_0413_rki_pc  unemployment_rate     anteil_beschaftigte_mit_akademis     stadtraum_dummy extreme_periphery_dummy latitude share_catholic  , vce(robust)
outreg2 using table2.xls, excel append   ci 2aster

* Model 7
reg  deaths_0413_rki_pc  unemployment_rate    anteil_beschaftigte_mit_akademis      stadtraum_dummy extreme_periphery_dummy latitude share_catholic  , vce(robust)
outreg2 using table2.xls, excel append  ci 2aster

* Model 8
reg deaths_new_0519_0413_pc cases_0413_rki_pc  unemployment_rate     anteil_beschaftigte_mit_akademis     stadtraum_dummy extreme_periphery_dummy latitude share_catholic  , vce(robust)
outreg2 using table2.xls, excel append   ci 2aster
